package com.nyist.diseasepreventionserver.converter;

import com.nyist.diseasepreventionserver.VO.UserListVO;
import com.nyist.diseasepreventionserver.dto.UserDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.stream.Collectors;

public class UserDTOPage2UserListVOConverter {
    public static UserListVO convert(UserDTO userDTO){
        UserListVO userListVO = new UserListVO();
        userListVO.setUserSid(userDTO.getUserSid());
        userListVO.setUserName(userDTO.getUserName());
        userListVO.setName(userDTO.getName());
        userListVO.setPhone(userDTO.getPhone());
        return userListVO;
    }
    public static List<UserListVO> convert(List<UserDTO> userDTOList){
        return userDTOList.stream().map(e -> convert(e)).collect(Collectors.toList());
    }
}
